 ///
 /// @file    multiDerived2.cc
 /// @author  lemon(haohb13@gmail.com)
 /// @date    2016-03-12 11:51:29
 ///
 
#include <iostream>
using std::cout;
using std::endl;


class A
{
public:
	A(int ix = 0) : _ix(ix)
	{
		cout << "A(int)" << endl;
	}

	void setX(int x)
	{	_ix = x;	}

	void diplay()
	{
		cout << "A::_ix = " << _ix << endl;
	}
protected:
	int _ix;
};

//虚继承的方式解决二义性的问题
class B : virtual public A
{};

class C : virtual public A
{};

class D : public B, public C
{
	
};

int main(void)
{
	D d;
	d.setX(5);
	d.diplay();
}
